package com.lqm.service.home;

import com.lqm.entity.home.HomeUser;
import com.lqm.entity.home.Project;
import com.lqm.entity.home.ProjectSupport;

import java.util.List;

/**
 * @program: CrowdFunding
 * @description
 * @author: lqm
 * @create: 2018-12-16 18:49
 */

public interface ProjectSupportService {
    /**
     * 获取某个项目的已经获得的所有支持金额
     * @param project
     * @return
     */
    double findSupportSumByProject(Project project);

    /**
     * 获取某个项目的投资信息(分页)
     * @param page
     * @param limit
     * @param project
     * @return
     */
    List<ProjectSupport> findAllByProject(int page, int limit,Project project);


    /**
     * 获取某个项目的投资条目数量
     * @param project
     * @return
     */
    Integer findAllByProjectCount(Project project);


    /**
     * 获取某个项目支持份数
     * @param project
     * @return
     */
    int findSupportSingleCount(Project project);


    /**
     * 获取某个项目支持人数
     * @param project
     * @return
     */
    int findSupportUserCount(Project project);

    /**
     * 获取某个用户支持的所有项目
     * @param homeUser
     * @return
     */
    List<ProjectSupport> findAllByHomeUser(int page, int limit,HomeUser homeUser);

    Integer findAllByHomeUserCount(HomeUser homeUser);





    /**
     * 投资一个项目
     * @param projectSupport 支持对象
     * @return 执行结果
     */
    String support(ProjectSupport projectSupport,HomeUser homeUser);

    /**
     * 发货
     * @param projectSupport
     * @return
     */
    ProjectSupport sendSupport(ProjectSupport projectSupport);
    /**
     * 完成此次回报
     * @param projectSupport
     * @return
     */
   ProjectSupport finishSupport(ProjectSupport projectSupport);
}
